package org.novelhibernate.test;

import org.novelhibernate.support.logging.FinallizedObject;
import org.novelhibernate.support.logging.annotation.DefaultExceptionHandling;
import org.novelhibernate.support.logging.annotation.ExceptionHandleMethod;
import org.novelhibernate.support.logging.annotation.ExceptionRegistry;
import org.novelhibernate.support.logging.annotation.LogTrigger;

public class LogClass implements ILogClass<String> {
	
	
	@LogTrigger(beforeLog="before", afterLog="after", exceptionLog="exception")
	@DefaultExceptionHandling(identifier="test")
	public int print(String a1, String s, int a, Object... o) throws Throwable{

		if ( o[o.length - 1] instanceof FinallizedObject){
		((FinallizedObject) o[o.length - 1]).setFinalHandler(
				new Object[] { new FinalClass() },
				new String[][] { new String[] { "doFinal" } });
		}
		String d = null;
d.charAt(0);
		return 0;
	}
	@ExceptionHandleMethod(methodID=1)
	public Object doSomething(Object[] o){
		
		System.out.print("exception capture done");
		return 0;
	}

}
